package com.carsystem.controller;

import com.carsystem.service.BusinessService;

import com.carsystem.utils.Result;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/business")
public class BusinessController {

    @Reference
    private BusinessService businessService;

    /**
     * 会员运营数据统计
     * @return
     */
    @GetMapping
    public Result getBusiness(){
        try {
            Map<String, Object> business = businessService.getBusiness();
            return new Result(true,"查询运营数据成功",business);
        } catch (Exception e) {
            e.printStackTrace();
            return new Result(false,"查询运营数据失败");
        }
    }
}
